//引入axios
import {get } from '@/utils/request'
export default {
    // 命名空间
    namespaced: true,
    state: {
        //栏目数组
        categoryData: []
    },
    mutations: {
        // 接收栏目数据
        SET_CATEGORYDATA(state, payload) {
            state.categoryData = payload

        }
    },
    actions: {
        // 分页查询所有栏目数据
        async getAllCategoryData({ commit }, payload) {
            let res = await get('/productCategory/pageQuery', payload)
            commit('SET_CATEGORYDATA', res.data.list)
        },

    }
}